package com.jims.master.modules.tj.service; /**
 * jims
 */

import com.jims.master.common.persistence.Page;
import com.jims.master.common.service.CrudService;
import com.jims.master.modules.tj.dao.TjHzAbnorDao;
import com.jims.master.modules.tj.dao.TjHzRecordDao;
import com.jims.master.modules.tj.entity.TjHzRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 体检客户基础信息Service
 * @author ct
 * @version 2018-05-04
 */
@Service
@Transactional(readOnly = true)
public class TjHzRecordService extends CrudService<TjHzRecordDao, TjHzRecord> {
	@Autowired
	private TjHzAbnorDao tjHzAbnorDao;

	public TjHzRecord get(String id) {
		return super.get(id);
	}
	
	public List<TjHzRecord> findList(TjHzRecord tjHzRecord) {
		return super.findList(tjHzRecord);
	}
	
	public Page<TjHzRecord> findPage(Page<TjHzRecord> page, TjHzRecord tjHzRecord) {
		return super.findPage(page, tjHzRecord);
	}
	
	@Transactional(readOnly = false)
	public int save(TjHzRecord tjHzRecord) {
		return super.save(tjHzRecord);
	}
	
	@Transactional(readOnly = false)
	public int delete(TjHzRecord tjHzRecord) {
		return super.delete(tjHzRecord);
	}

	public List<TjHzRecord> getRecordList(String cardNumber){
		List<TjHzRecord> lis = dao.getRecordList(cardNumber);
		/*for(int i =0;i<lis.size();i++){
			lis.get(i).setTjHzAbnor(tjHzAbnorDao.getByRecordNo(lis.get(i).getRecordNo()));
		}*/
		return lis;
	}

	public TjHzRecord getByRecordNo(String recordNo){
		TjHzRecord tjHzRecord = dao.getByRecordNo(recordNo);
		return tjHzRecord;
	}
	@Transactional(readOnly = false)
	public int updatePublic(String state,String id) {
		return dao.updatePublic(state,id);
	}

}